<div class="technical main">
  <bid-tabs
    query-fn="techTraining.paginationQuery"
    query-bean="techTraining.educationList"
    query-param="organizationDepartmentId"
    teams-data="techTraining.teamWithOrgList"></bid-tabs>
  <div class="query-info shadowbox">
    <div class="container-header">教育培训</div>
    <form name="queryForm" class="base-info pa-form-content">
      <div class="pa-form-control pa-form-control-inline">
        <label class="name">培训主题：</label>
        <input type="text" class="form-control-input"
          ng-model="techTraining.educationList.theme " />
      </div>
      <div class="pa-form-control pa-form-control-inline">
        <label class="name">施工队：</label>
        <select name="crews" class="pa-input-select" 
          ng-model="techTraining.educationList.constructionTeamId">
          <option value=""></option>
          <optgroup ng-repeat="teamGroup in techTraining.teamWithOrgList"
            label="{{teamGroup.orgUnitName}}">
            <option ng-repeat="team in teamGroup.teamList"
              value="{{team.teamId}}">
              {{team.teamName}}
            </option>
          </optgroup>
        </select>
      </div>
      <div class="pa-form-control pa-form-control-inline">
        <label class="name">培训时间：</label>
        <input type="text" name="startTime" ng-datepicker 
          ng-model="techTraining.educationList.startTime" />
        到
        <input type="text" name="endTime" ng-datepicker
          ng-model="techTraining.educationList.endTime" />
      </div>          
    </form>
    <div class="btn-outer-right">
      <a class="pa-btn" ng-click="techTraining.query(queryForm)">
        <i class="fa fa-search"></i>
        <span class="ml5">查询</span>
      </a>
      <a class="pa-btn reset-btn" ng-click="techTraining.reset();">
        <i class="fa fa-repeat"></i>
        <span class="ml5">重置</span>
      </a>
    </div>
  </div>
  <div class="pa-table-container shadowbox technical-detail">
    <div class="list-title"
      authorization-btn="api/education/insertEducationInfo"
      ng-click="techTraining.openTrainingPlan()">   
      <img src="../../../assets/images/add-item-peixun.png" /> 
      <span>新增教育培训</span> 
    </div>
    <form class="base-info">
      <table class="pa-table">
        <thead>
          <tr>
            <th>主题</th>
            <th class="time-sequence">
              <div>培训时间</div>
              <div class="time-sequence-btn">
                <div class="time-sequence-box"
                  ng-click="techTraining.up('train_time','0')">
                  <i class="fa fa-caret-up"></i>
                </div>
                <div class="time-sequence-box"
                  ng-click="techTraining.up('train_time','1')">
                  <i class="fa fa-caret-down"></i>
                </div> 
              </div>
            </th>
            <th>组织部门</th>
            <th>施工队</th>
            <th>参加人数</th>
            <th class="tech-operation">操作</th>
          </tr>
        </thead>
        <tbody>
          <tr ng-repeat="item in techTraining.technicalItemList">
            <td>{{item.theme}}</td>
            <td>{{item.trainTime}}</td>
            <td>{{item.organizationDepartmentName}}</td>
            <td>
              <div class="show-construction">
                <span ng-repeat="team in item.educationTrainConTeam">
                  {{$index == item.educationTrainConTeam.length - 1 ?
                  team.constructionTeamName : (team.constructionTeamName+",")}}
                </span>               
              </div>
            </td>
            <td>{{item.num}}</td>
            <td>
              <div class="del"
                authorization-btn="api/education/queryEducationInfo"
                ng-click="techTraining.queryDisclosure(item.id)">
                <i class="fa fa-street-view color"></i>
                <span>查看</span>
              </div>
              <div class="del"
                authorization-btn="api/education/queryEducationInfo"
                ng-click="techTraining.editDisclosure(item)">
                <i class="fa fa-pencil color"></i>
                <span>编辑</span>
              </div>
              <div class="del"
                authorization-btn="api/education/deleteEducationInfo"
                ng-click="techTraining.delete(item.id)">
                <i class="fa fa-trash color"></i>
                <span>删除</span>
              </div>
            </td>
          </tr>
        </tbody>
      </table>
      <div class="total-num">
        共计<span class="total-num-colorful">{{techTraining.paginationData.total}}</span>条
      </div>
      <!-- 分页 -->
      <div class="pagination-outer">
        <uib-pagination
          total-items="techTraining.paginationData.total"
          ng-model="techTraining.paginationData.pageNum"
          items-per-page="techTraining.paginationData.pageSize"
          ng-change="pageChange()"
          class="pagination-sm"
          boundary-link-numbers="true"
          max-size="5"
          next-text="下一页"
          previous-text="上一页"></uib-pagination>
      </div>
    </form>
    </div>
</div>

<!-- 新增教育培训计划 -->
<script type="text/ng-template" id="openTrainingPlan">
  <div class="item-detail-dialog training-tech">  
    <div class="item-detail-dialog-header"> 
      <div class="title-txt">
        <span>新增教育培训计划</span> 
      </div>
    </div>  
    <div class="item-detail-dialog-content">
      <form name="tech" id="safe" role="form" novalidate>
        <div class="row-item">
          <div class="fixed-left-label"><b>*</b>主题：</div> 
          <div class="right-value">
            <input type="text" name="theme" required
              ng-model="vm.techTrainList.theme" />
          </div> 
          <span class="error-tip"
            ng-show="(tech.$submitted || tech.theme.$dirty) && tech.theme.$invalid">
            必填
          </span>
        </div>  
        <div class="row-item"> 
          <div class="fixed-left-label"><b>*</b>培训时间：</div>
          <div class="right-value">
            <input type="text" name="techTime" ng-datepicker required 
              ng-model="vm.techTrainList.trainTime" />  
          </div> 
          <span class="error-tip"
            ng-show="(tech.$submitted || tech.techTime.$dirty) && tech.techTime.$invalid">
            必填
          </span>
        </div>
        <div class="row-item"> 
          <div class="fixed-left-label">学时：</div> 
          <div class="right-value">
            <input type="text" name="period"
              ng-model="vm.techTrainList.period" integer/> 
          </div>
          <span class="error-tip"          
            ng-show="(tech.$submitted || tech.period.$dirty) && tech.period.$error.integer">
            填数字
          </span>  
        </div>
        <div class="row-item">  
          <div class="fixed-left-label">地点：</div>  
          <div class="right-value"> 
            <input type="text" class="form-control" 
              ng-model="vm.techTrainList.place" />  
          </div>  
        </div>
        <div class="row-item">
          <div class="fixed-left-label"><b>*</b>组织部门：</div>
          <div class="right-value">
            <select name="orgUnit" required 
              ng-model="vm.techTrainList.organizationDepartmentId"
              ng-options="item.orgUnitId as item.orgUnitName for item in orgs"></select>
          </div>
          <span class="error-tip"
            ng-show="(tech.$submitted || tech.orgUnit.$dirty) && tech.orgUnit.$invalid">
            必填
          </span>
        </div>  
        <div class="row-item">
          <div class="fixed-left-label"><b>*</b>参加人员：</div>
           <!-- 下拉多选-->
          <div class="right-value" id="take_part_workers">
            <button class="show_btn"
              ng-click="vm.isShowSelect=!vm.isShowSelect">
              请选择
            </button>
            <!--   <input type="text" style="width: 100%;padding: 0 10px;"> -->
            <div class="show_content" ng-show="vm.isShowSelect">
              <div ng-repeat="teamGroup in vm.teamWithOrgList">
                <label class="team-unit">{{teamGroup.orgUnitName}}</label>
                  <dl ng-repeat = "team in teamGroup.teamList"> 

                    <dd>
                      <input type="checkbox"
                        ng-model="team.checked"
                        ng-click="vm.checkAll(team,$event)"/>
                      <span class="team-construction"
                        ng-click="vm.showWorkers(team)">
                        {{team.teamName}}
                      </span>
                    </dd>
                    <dt ng-show="team.isShowWorker"
                      ng-repeat="worker in team.workerInfoBeanList">
                      <input type="checkbox" 
                        ng-model="worker.checked"
                        ng-change="vm.isChange(team.teamId);" />
                      {{worker.workerName}}
                    </dt>
                  </dl>
              </div>
              <center ng-show="vm.teamWithOrgList.length == 0">暂无数据</center>
            </div>  
          </div>
          <span class="error-tip"
            ng-show="vm.showTeam">
            必填
          </span>
        </div>
        <common-attachment-upload
          component-id="cp2"
          pick-btn-id="avatar_attachment_picker"
          upload-url="{{fileUploadUrl.technicalDisclosure}}"
          file-list="vm.profilesToken"></avatar-attachment-upload> 
      </form>
    </div> 
    <div class="item-detail-dialog-footer"> 
      <a class="pa-btn" ng-click="vm.save(tech)">  
        <i class="fa fa-save"></i>  
        <span class="ml5">确定</span>  
      </a> 
      <a class="pa-btn" ng-click="closeThisDialog()"> 
        <i class="fa fa-times"></i> 
        <span class="ml5">取消</span>
      </a> 
    </div>  
  </div>  
</script>

<!--编辑教育培训列表培训信息-->
<script type="text/ng-template" id="alterInfoDisclosure">
  <div class="item-detail-dialog training-tech">
    <div class="item-detail-dialog-header">
      <div class="title-txt">
        <span>编辑教育培训</span>
      </div>
    </div>
    <div class="item-detail-dialog-content">
      <form name="editInfo" id="editInfo" role="form" novalidate>
        <div class="row-item">
          <div class="fixed-left-label"><b>*</b>主题：</div>
          <div class="right-value">
            <input type="text" name="trainTheme" required  
              ng-model="vm.disclosureList.theme" />
          </div>
          <span class="error-tip"
            ng-show="(editInfo.$submitted || editInfo.trainTheme.$dirty) && editInfo.trainTheme.$invalid">
            必填
          </span>
        </div>
        <div class="row-item">
          <div class="fixed-left-label"><b>*</b>培训时间：</div>
          <div class="right-value">
            <input ng-datepicker name="trainTime" required 
              ng-model="vm.disclosureList.trainTime" />
          </div>
          <span class="error-tip"
            ng-show="(editInfo.$submitted || editInfo.trainTime.$dirty) && editInfo.trainTime.$invalid">
            必填
          </span>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">学时：</div>
          <div class="right-value">
            <input type="text" name="period"
              ng-model="vm.disclosureList.period" integer/>
          </div>
          <span class="error-tip"          
            ng-show="(editInfo.$submitted || editInfo.period.$dirty) && editInfo.period.$error.integer">
            填数字
          </span>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">组织部门：</div>
          <div class="right-value">
            <input type="text" disabled
              ng-model="vm.disclosureList.organizationDepartmentName" />
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">施工队：</div>
          <div class="right-value">
            <ul>
              <li class="con-team"
                ng-repeat = "item in vm.disclosureList.educationTrainConTeam">
                {{item.constructionTeamName}}
              </li>
            </ul>
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">地点：</div>
          <div class="right-value">
            <input type="text"
              ng-model="vm.disclosureList.place" />
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label"><b>*</b>参加人员：</div>
           <!-- 下拉多选-->
          <div class="right-value" id="take_part_workers">
            <button class="show_btn"
              ng-click="vm.isShowSelect=!vm.isShowSelect">
              请选择
            </button>
            <div class="show_content" ng-show="vm.isShowSelect">
              <div ng-repeat="teamGroup in vm.teamWithOrgList">
                <label class="team-unit">{{teamGroup.orgUnitName}}</label>
                  <dl ng-repeat = "team in teamGroup.teamList"> 

                    <dd>
                      <input type="checkbox"
                        ng-model="team.checked"
                        ng-click="vm.checkAll(team,$event)"/>
                      <span class="team-construction"
                        ng-click="vm.showWorkers(team)">
                        {{team.teamName}}
                      </span>
                    </dd>
                    <dt ng-show="team.isShowWorker"
                      ng-repeat = "worker in team.workerInfoBeanList">
                      <input type="checkbox"
                        ng-change="vm.isChange(team.teamId);"
                        ng-model="worker.checked" />
                      {{worker.workerName}}
                    </dt>

                  </dl>
              </div>
              <center ng-show="vm.teamWithOrgList.length == 0">暂无数据</center>
            </div>  
          </div>
          <span class="error-tip"
            ng-show="vm.showTeam">
            必填
          </span>
        </div>
        <!-- 上传文件 -->
        <common-attachment-upload
          component-id="cp2"
          file-type="file"
          pick-btn-id="avatar_attachment_picker"
          upload-url="{{fileUploadUrl.technicalDisclosure}}"
          file-list="vm.disclosureList.fileBeans"></common-attachment-upload>
      </form>
    </div>
    <div class="item-detail-dialog-footer">
      <a class="pa-btn"
        authorization-btn="api/education/updateEducationInfo"
        ng-click="vm.submit(editInfo)">
        <i class="fa fa-save"></i>
        <span class="ml5">确定</span>
      </a>
      <a class="pa-btn" ng-click="closeThisDialog()">
        <i class="fa fa-times"></i>
        <span class="ml5">取消</span>
      </a>
    </div>
  </div>
</script>